<?php
if( ! defined('BASEPATH')) exit('No direct script access allowed');

class Questions extends CI_Controller
{
	function __construct()
	{
		parent::__construct();
		// check if user logged in
		if(!$this->ion_auth->logged_in()){
			redirect('auth/login');	}
		$this->load->library('form_validation');		
		$this->load->model('client/client_model');
		$this->load->model('client/question_model');
	}

	function index(){		
		$meta['page_title'] = "Client Questions";
		$data['user_id'] = 0;		
		$data['users'] = $this->ion_auth->users()->result();
		$this->load->view('common/header', $meta);
		$this->load->view('founder/questions',$data);
		$this->load->view('common/footer');
	}
	
	function get_question_by_client_id(){
		$input = $this->input->post();
		$data['user_id'] = $input['user'];
		$data['users'] = $this->ion_auth->users()->result();
		$data['my_questions'] = $this->question_model->get_question_by_client_id($data['user_id']);
		$meta['page_title'] = "Client Questions";		
		$this->load->view('common/header', $meta);
		$this->load->view('founder/questions',$data);
		$this->load->view('common/footer');
	}	
}


?>